import Vue from 'vue';
import VueRouter from 'vue-router';
import Home from '../views/Home.vue';

Vue.use(VueRouter);

const routes = [
    {
        path: '/',
        name: 'Home',
        component: Home
    },
    {
        path: '/about',
        name: 'About',
        // route level code-splitting
        // this generates a separate chunk (about.[hash].js) for this route
        // which is lazy-loaded when the route is visited.
        component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
    },
    {
        // 车辆违法管理
        path: '/Illegal',
        component: resolve => require(['../views/Illegal/Illegal.vue'], resolve),
        meta: { title: '车辆违法管理' }
    },{
        // 车辆违法管理
        path: '/useapply',
        component: resolve => require(['../views/useapply/useapply.vue'], resolve),
        meta: { title: '用车申请' }
    },{
        // 车辆违法管理
        path: '/useapplyAudit',
        component: resolve => require(['../views/useapply/useapplyAudit.vue'], resolve),
        meta: { title: '用车申请审核' }
    },
];

const router = new VueRouter({
    mode: 'history',
    base: process.env.BASE_URL,
    routes
});

export default router;
